package local.util;

import java.util.*;

public class MyPrint {

    public static void printHashTable (Hashtable htb) {
	Enumeration enum = htb.keys();  
	while (enum.hasMoreElements()) {
	    String key = (String)enum.nextElement();
	    System.out.println(key+"\t"+htb.get(key));
	}
    }

    public static void printVector( Vector inputV, int total_columns, int output_column) {

	int t = total_columns;
	int o = output_column;
	int n =0;
	String temp = null;
	Enumeration penum = inputV.elements();
	while ( penum.hasMoreElements()) {
	    n++;
	    temp = (String)penum.nextElement();
	    if (n == o) {
		System.out.println(temp);
	    }
	    else if (n == t){
		n = 0;
	    }
	}
    }

   public static void printVector( Vector inputV, int colum_number) {

	int m = colum_number;
	int n =0;
	Enumeration penum = inputV.elements();
	while ( penum.hasMoreElements()) { 
	   System.out.print(penum.nextElement()+"\t");
	   n++;
	   if (n%m==0) {
	       System.out.println();
	   }
	}
    }

    public static void printVector( Vector inputV) {

	Enumeration penum = inputV.elements();
	while ( penum.hasMoreElements()) { 
	   System.out.print(penum.nextElement()+"\t");
	}
	System.out.println();
    }

    public static void printVectorVector( Vector inputV, int element_at) {
	Vector temp_v = new Vector ();
	Enumeration penum = inputV.elements();
	while ( penum.hasMoreElements()) {
	    temp_v =(Vector)penum.nextElement();
	    printVector(temp_v, element_at);
	}
	System.out.println();
    }

    public static void mainHelp (StringBuffer sbf) {
	System.out.println(sbf.toString());
    }

    public static void message (String message) {
	System.out.println(message);
    }

    public static void printLine(String type, int length) {
	for (int i = 0; i < length; i++) {
	    System.out.print(type);
	}
	System.out.println();
    }
}





